package com.hm.scala.senior

import scala.collection.mutable.ArrayBuffer

object ListTest {

  def main(args: Array[String]): Unit = {

    var array = List("aa", "bb", "cc");
    for (i <- array) {
      println(i)
    }
    println("-------------------------------------")
    var array2 = "11" :: "22" :: "33" :: List();
    for (i <- array2) {
      println(i)
    }
    println("-------------------------------------")
    var array3 = new ArrayBuffer[Int]

    //为列表添加元素
    array3 += 4
    for (i <- array3) {
      println(i)
    }

  }
}